<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="Zabbix获取在网站 https:&#x2F;&#x2F;www.zabbix.com&#x2F;cn&#x2F;download_sources 下载安装包zabbix-4.0.19.tar.gz 到&#x2F;usr&#x2F;src&#x2F; 服务器时间同步服务器时间若不准确会导致Zabbix编译安装会失败 12345# ntpdate ntp1.aliyun.com或# ntpdate us.pool.ntp.org或# ntpdate time.win">
<meta property="og:type" content="article">
<meta property="og:title" content="Zabbix 4.0安装">
<meta property="og:url" content="http://example.com/2020/04/22/Zabbix%204.0%E5%AE%89%E8%A3%85/index.html">
<meta property="og:site_name" content="Man In The Mirror">
<meta property="og:description" content="Zabbix获取在网站 https:&#x2F;&#x2F;www.zabbix.com&#x2F;cn&#x2F;download_sources 下载安装包zabbix-4.0.19.tar.gz 到&#x2F;usr&#x2F;src&#x2F; 服务器时间同步服务器时间若不准确会导致Zabbix编译安装会失败 12345# ntpdate ntp1.aliyun.com或# ntpdate us.pool.ntp.org或# ntpdate time.win">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-04-22T03:28:28.000Z">
<meta property="article:modified_time" content="2020-12-26T08:29:46.922Z">
<meta property="article:author" content="Rock Qin">
<meta property="article:tag" content="Zabbix">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://example.com/2020/04/22/Zabbix%204.0%E5%AE%89%E8%A3%85/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'en'
  };
</script>

  <title>Zabbix 4.0安装 | Man In The Mirror</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Man In The Mirror</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>About</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>Categories</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>Search
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="Searching..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://example.com/2020/04/22/Zabbix%204.0%E5%AE%89%E8%A3%85/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/rock.jpg">
      <meta itemprop="name" content="Rock Qin">
      <meta itemprop="description" content="人生若只如初见">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Man In The Mirror">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Zabbix 4.0安装
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-04-22 11:28:28" itemprop="dateCreated datePublished" datetime="2020-04-22T11:28:28+08:00">2020-04-22</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">Edited on</span>
                <time title="Modified: 2020-12-26 16:29:46" itemprop="dateModified" datetime="2020-12-26T16:29:46+08:00">2020-12-26</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="Views" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">Views: </span>
              <span id="busuanzi_value_page_pv"></span>
            </span><br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>3.5k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>3 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="Zabbix获取"><a href="#Zabbix获取" class="headerlink" title="Zabbix获取"></a>Zabbix获取</h1><p>在网站 <a target="_blank" rel="noopener" href="https://www.zabbix.com/cn/download_sources">https://www.zabbix.com/cn/download_sources</a> 下载安装包zabbix-4.0.19.tar.gz 到/usr/src/</p>
<h1 id="服务器时间同步"><a href="#服务器时间同步" class="headerlink" title="服务器时间同步"></a>服务器时间同步</h1><p>服务器时间若不准确会导致Zabbix编译安装会失败</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># ntpdate ntp1.aliyun.com</span><br><span class="line">或</span><br><span class="line"># ntpdate us.pool.ntp.org</span><br><span class="line">或</span><br><span class="line"># ntpdate time.windows.com</span><br></pre></td></tr></table></figure>
<a id="more"></a>

<h1 id="MySQL安装及数据库创建"><a href="#MySQL安装及数据库创建" class="headerlink" title="MySQL安装及数据库创建"></a>MySQL安装及数据库创建</h1><p>MySQL可以yum安装或编译安装，参考之前文档</p>
<h2 id="1-Zabbix数据库账号创建"><a href="#1-Zabbix数据库账号创建" class="headerlink" title="1. Zabbix数据库账号创建"></a>1. Zabbix数据库账号创建</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">mysql&gt; alter user &#39;root&#39;@&#39;localhost&#39; identified by &#39;Zabbix!123&#39;;</span><br><span class="line"></span><br><span class="line">mysql&gt; create database zabbix character set utf8 collate utf8_bin;</span><br><span class="line"></span><br><span class="line">mysql&gt; grant all privileges on zabbix.* to zabbix@localhost identified by &#39;Zabbix!123&#39;;</span><br></pre></td></tr></table></figure>
<h2 id="2-Zabbix数据库导入"><a href="#2-Zabbix数据库导入" class="headerlink" title="2. Zabbix数据库导入"></a>2. Zabbix数据库导入</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># tar zxvf zabbix-4.0.19.tar.gz</span><br><span class="line"></span><br><span class="line"># cd &#x2F;usr&#x2F;src&#x2F;zabbix-4.0.19&#x2F;database&#x2F;mysql</span><br></pre></td></tr></table></figure>
<p>导入：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># mysql -uzabbix -p&#39;Zabbix!123&#39; zabbix &lt; schema.sql</span><br><span class="line"># mysql -uzabbix -p&#39;Zabbix!123&#39; zabbix &lt; images.sql</span><br><span class="line"># mysql -uzabbix -p&#39;Zabbix!123&#39; zabbix &lt; data.sql</span><br></pre></td></tr></table></figure>
<h1 id="依赖包安装"><a href="#依赖包安装" class="headerlink" title="依赖包安装"></a>依赖包安装</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># yum install libxml2-devel libcurl-devel libevent-devel net-snmp-devel mysql-community-devel -y</span><br></pre></td></tr></table></figure>
<h1 id="创建zabbix用户和组"><a href="#创建zabbix用户和组" class="headerlink" title="创建zabbix用户和组"></a>创建zabbix用户和组</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># groupadd zabbix</span><br><span class="line"># useradd -g zabbix zabbix -s &#x2F;sbin&#x2F;nologin</span><br></pre></td></tr></table></figure>
<h1 id="openjdk安装"><a href="#openjdk安装" class="headerlink" title="openjdk安装"></a>openjdk安装</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># yum search openjdk</span><br><span class="line"># yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel -y</span><br></pre></td></tr></table></figure>
<h1 id="编译安装Zabbix"><a href="#编译安装Zabbix" class="headerlink" title="编译安装Zabbix"></a>编译安装Zabbix</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># .&#x2F;configure --prefix&#x3D;&#x2F;usr&#x2F;local&#x2F;zabbix --enable-server --enable-agent --enable-java --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2</span><br><span class="line"></span><br><span class="line"># make install</span><br></pre></td></tr></table></figure>
<p>Zabbix安装目录：/usr/local/zabbix</p>
<h1 id="Zabbix-Server配置文件"><a href="#Zabbix-Server配置文件" class="headerlink" title="Zabbix Server配置文件"></a>Zabbix Server配置文件</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># vi &#x2F;usr&#x2F;local&#x2F;zabbix&#x2F;etc&#x2F;zabbix_server.conf</span><br></pre></td></tr></table></figure>
<p>修改：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">DBHost&#x3D;localhost</span><br><span class="line">DBName&#x3D;zabbix</span><br><span class="line">DBUser&#x3D;zabbix</span><br><span class="line">DBPassword&#x3D;Zabbix!123</span><br></pre></td></tr></table></figure>

<h1 id="启动Zabbix-Server服务"><a href="#启动Zabbix-Server服务" class="headerlink" title="启动Zabbix Server服务"></a>启动Zabbix Server服务</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># &#x2F;usr&#x2F;local&#x2F;zabbix&#x2F;sbin&#x2F;zabbix_server </span><br></pre></td></tr></table></figure>
<p>或设置Zabbix启动服务：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># vi &#x2F;usr&#x2F;lib&#x2F;systemd&#x2F;system&#x2F;zabbix-server.service</span><br></pre></td></tr></table></figure>
<p>添加：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">[Unit]</span><br><span class="line">Description&#x3D;Zabbix Server</span><br><span class="line">After&#x3D;syslog.target</span><br><span class="line">After&#x3D;network.target</span><br><span class="line"></span><br><span class="line">[Service]</span><br><span class="line">Environment&#x3D;&quot;CONFFILE&#x3D;&#x2F;usr&#x2F;local&#x2F;zabbix&#x2F;etc&#x2F;zabbix_server.conf&quot;</span><br><span class="line">EnvironmentFile&#x3D;-&#x2F;etc&#x2F;sysconfig&#x2F;zabbix-server</span><br><span class="line">Type&#x3D;forking</span><br><span class="line">Restart&#x3D;on-failure</span><br><span class="line">PIDFile&#x3D;&#x2F;tmp&#x2F;zabbix_server.pid</span><br><span class="line">KillMode&#x3D;control-group</span><br><span class="line">ExecStart&#x3D;&#x2F;usr&#x2F;local&#x2F;zabbix&#x2F;sbin&#x2F;zabbix_server -c $CONFFILE</span><br><span class="line">ExecStop&#x3D;&#x2F;bin&#x2F;kill -SIGTERM $MAINPID</span><br><span class="line">RestartSec&#x3D;10s</span><br><span class="line">TimeoutSec&#x3D;0</span><br><span class="line"></span><br><span class="line">[Install]</span><br><span class="line">WantedBy&#x3D;multi-user.target</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<h1 id="启动Zabbix-Agent服务"><a href="#启动Zabbix-Agent服务" class="headerlink" title="启动Zabbix Agent服务"></a>启动Zabbix Agent服务</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># &#x2F;usr&#x2F;local&#x2F;zabbix&#x2F;sbin&#x2F;zabbix_agentd </span><br></pre></td></tr></table></figure>
<p>检查Zabbix相关服务：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># ps -ef | grep zabbix</span><br></pre></td></tr></table></figure>
<h1 id="部署Zabbix-Web界面"><a href="#部署Zabbix-Web界面" class="headerlink" title="部署Zabbix Web界面"></a>部署Zabbix Web界面</h1><p>Zabbix Web前端使用PHP，所以必须运行在支持PHP的Web服务器上</p>
<h2 id="1-复制Zabbix的php文件"><a href="#1-复制Zabbix的php文件" class="headerlink" title="1. 复制Zabbix的php文件"></a>1. 复制Zabbix的php文件</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># cd &#x2F;usr&#x2F;src&#x2F;zabbix-4.0.19</span><br><span class="line"># cp &#x2F;usr&#x2F;src&#x2F;zabbix-4.0.19&#x2F;frontends&#x2F;php&#x2F;* &#x2F;usr&#x2F;local&#x2F;nginx&#x2F;html&#x2F; -rf</span><br></pre></td></tr></table></figure>
<h2 id="2-在Nginx上设置站点"><a href="#2-在Nginx上设置站点" class="headerlink" title="2. 在Nginx上设置站点"></a>2. 在Nginx上设置站点</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># vi &#x2F;usr&#x2F;local&#x2F;nginx&#x2F;conf&#x2F;nginx.conf </span><br></pre></td></tr></table></figure>
<p>添加：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">server &#123;</span><br><span class="line">    listen          80;</span><br><span class="line">    server_name     localhost;</span><br><span class="line"></span><br><span class="line">    access_log      logs&#x2F;zabbix.access.log  main;</span><br><span class="line"></span><br><span class="line">    location &#x2F; &#123;</span><br><span class="line">            root    html;</span><br><span class="line">            index   index.php index.html index.htm;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    location ~ \.php$ &#123;</span><br><span class="line">            root                    html;</span><br><span class="line">            fastcgi_pass    127.0.0.1:9000;</span><br><span class="line">            fastcgi_index   index.php;</span><br><span class="line">            fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;</span><br><span class="line">            include         fastcgi_params;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>重启Nginx服务，测试是否能正常开启Zabbix配置向导网站 <a target="_blank" rel="noopener" href="http://192.168.229.88/">http://192.168.229.88</a></p>
<h1 id="Zabbix配置向导"><a href="#Zabbix配置向导" class="headerlink" title="Zabbix配置向导"></a>Zabbix配置向导</h1><p>根据向导提示信息修改php配置</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"># vi &#x2F;usr&#x2F;local&#x2F;php&#x2F;etc&#x2F;php.ini</span><br></pre></td></tr></table></figure>
<p>修改如下配置：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">post_max_size &#x3D; 16M</span><br><span class="line">max_execution_time &#x3D; 300</span><br><span class="line">max_input_time &#x3D; 300</span><br><span class="line">date.timezone &#x3D; Asia&#x2F;Shanghai</span><br><span class="line">always_populate_raw_post_data &#x3D; -1</span><br></pre></td></tr></table></figure>
<h1 id="Zabbix需要启动的服务："><a href="#Zabbix需要启动的服务：" class="headerlink" title="Zabbix需要启动的服务："></a>Zabbix需要启动的服务：</h1><ul>
<li>mysql (# systemctl start mysqld.service)</li>
<li>nginx (# systemctl start nginx.service)</li>
<li>php (# systemctl start php-fpm.service)</li>
<li>zabbix_server (# systemctl start zabbix-server.service)</li>
<li>zabbix_agentd (需执行运行: # /usr/local/zabbix/sbin/zabbix_agentd)</li>
</ul>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Zabbix/" rel="tag"># Zabbix</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/04/22/Nginx%E5%AE%89%E8%A3%85/" rel="prev" title="Nginx安装">
      <i class="fa fa-chevron-left"></i> Nginx安装
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/12/21/NFS%E6%9C%8D%E5%8A%A1/" rel="next" title="NFS服务">
      NFS服务 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Zabbix%E8%8E%B7%E5%8F%96"><span class="nav-number">1.</span> <span class="nav-text">Zabbix获取</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%97%B6%E9%97%B4%E5%90%8C%E6%AD%A5"><span class="nav-number">2.</span> <span class="nav-text">服务器时间同步</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#MySQL%E5%AE%89%E8%A3%85%E5%8F%8A%E6%95%B0%E6%8D%AE%E5%BA%93%E5%88%9B%E5%BB%BA"><span class="nav-number">3.</span> <span class="nav-text">MySQL安装及数据库创建</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-Zabbix%E6%95%B0%E6%8D%AE%E5%BA%93%E8%B4%A6%E5%8F%B7%E5%88%9B%E5%BB%BA"><span class="nav-number">3.1.</span> <span class="nav-text">1. Zabbix数据库账号创建</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-Zabbix%E6%95%B0%E6%8D%AE%E5%BA%93%E5%AF%BC%E5%85%A5"><span class="nav-number">3.2.</span> <span class="nav-text">2. Zabbix数据库导入</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BE%9D%E8%B5%96%E5%8C%85%E5%AE%89%E8%A3%85"><span class="nav-number">4.</span> <span class="nav-text">依赖包安装</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%88%9B%E5%BB%BAzabbix%E7%94%A8%E6%88%B7%E5%92%8C%E7%BB%84"><span class="nav-number">5.</span> <span class="nav-text">创建zabbix用户和组</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#openjdk%E5%AE%89%E8%A3%85"><span class="nav-number">6.</span> <span class="nav-text">openjdk安装</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85Zabbix"><span class="nav-number">7.</span> <span class="nav-text">编译安装Zabbix</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Zabbix-Server%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="nav-number">8.</span> <span class="nav-text">Zabbix Server配置文件</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%90%AF%E5%8A%A8Zabbix-Server%E6%9C%8D%E5%8A%A1"><span class="nav-number">9.</span> <span class="nav-text">启动Zabbix Server服务</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%90%AF%E5%8A%A8Zabbix-Agent%E6%9C%8D%E5%8A%A1"><span class="nav-number">10.</span> <span class="nav-text">启动Zabbix Agent服务</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E9%83%A8%E7%BD%B2Zabbix-Web%E7%95%8C%E9%9D%A2"><span class="nav-number">11.</span> <span class="nav-text">部署Zabbix Web界面</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E5%A4%8D%E5%88%B6Zabbix%E7%9A%84php%E6%96%87%E4%BB%B6"><span class="nav-number">11.1.</span> <span class="nav-text">1. 复制Zabbix的php文件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E5%9C%A8Nginx%E4%B8%8A%E8%AE%BE%E7%BD%AE%E7%AB%99%E7%82%B9"><span class="nav-number">11.2.</span> <span class="nav-text">2. 在Nginx上设置站点</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Zabbix%E9%85%8D%E7%BD%AE%E5%90%91%E5%AF%BC"><span class="nav-number">12.</span> <span class="nav-text">Zabbix配置向导</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Zabbix%E9%9C%80%E8%A6%81%E5%90%AF%E5%8A%A8%E7%9A%84%E6%9C%8D%E5%8A%A1%EF%BC%9A"><span class="nav-number">13.</span> <span class="nav-text">Zabbix需要启动的服务：</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Rock Qin"
      src="/images/rock.jpg">
  <p class="site-author-name" itemprop="name">Rock Qin</p>
  <div class="site-description" itemprop="description">人生若只如初见</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">6</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">2</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/bluemirror" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;bluemirror" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:rockqin@126.com" title="E-Mail → mailto:rockqin@126.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://cn.bing.com/" title="https:&#x2F;&#x2F;cn.bing.com&#x2F;" rel="noopener" target="_blank">Bing</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.google.com/" title="https:&#x2F;&#x2F;www.google.com" rel="noopener" target="_blank">Google</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Rock Qin</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="Symbols count total">14k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="Reading time total">12 mins.</span>
</div>


<!--
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a>
  </div>
-->

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  

</body>
</html>
